#ifndef CLOUDSVR_H
#define CLOUDSVR_H
#define ASIO_STANDALONE
#define ASIO_HAS_STD_TYPE_TRAITS
#define ASIO_HAS_THREADS
#define ASIO_HAS_STD_ATOMIC
#define ASIO_HAS_STD_SHARED_PTR
#define ASIO_HAS_STD_ADDRESSOF
#define ASIO_HAS_CSTDINT
#define ASIO_HAS_STD_ARRAY

#pragma comment(lib, "ws2_32.lib")

#include "../../asio/include/asio.hpp"
#include <map>

struct MSGHeader {
    char type;
    int seq;


};

struct BT{
    MSGHeader header;
    char id[50];
    //int port;
};

struct WakeUP{
    MSGHeader header;
    char id[50];
    //int port;
};
struct IPInfo{

    asio::ip::udp::udp::endpoint addr;
};

class CCloudSvr
{
    public:
        CCloudSvr();
        virtual ~CCloudSvr();
        void SetPort(int port);
        void begin();

    protected:
        int m_nPort;
        asio::ip::udp::socket *m_pSocket;
        asio::io_context io_context;
    protected:

        std::map<std::string,IPInfo> mapForIP;
    private:
};

#endif // CLOUDSVR_H
